// import http from "@/utils/http";
import https from "@/utils/https";
export const loginAPI = ({ account , password }) => {
  return https({
    url: "/user/login",  //原本木有/user
    method: "post",
    data: { account, password }
  });
};

export const getLikeListAPI = ({ limit = 4 }) => {
  return https({
    url:'/goods/relevant',
    params: {
      limit 
    }
  })
}

/*
params: {
	orderState:0,
  page:1,
  pageSize:2
}
*/
export const getUserOrder = (params) => {
  return https({
    url:'/member/order',
    method:'GET',
    params
  })
}

export const cancelOrderAPI = (orderId) => {
  return https({
    url:`/member/order/cancel/${orderId}`,
    method:'PUT'
  })
}

export const handleDelOrderAPI = (orderId) => {
  return https({
    url:`/member/order/${orderId}`,
    method:'DELETE'
  })
}

export const receiveItemAPI = (orderId) => {
  return https({
    url:`/member/order/confirm/${orderId}`,
    method:'PUT'
  })
}

export const getAddressAPI = () => {
  return https({
    url:'/member/address',
    method:'GET'
  })
}

export const setDefaultAPI = (id) => {
  return https({
    url:`/member/address/setDefault`,
    method:'PUT',
    params:{id}
  })
}